import re

str1='hello123hello'
str2='''
hello123hello
hello1hello
'''

# result=re.match('\d+hello',str1)    #match 匹配开头


result=re.match('\shello[\d,\D]+h',str2)
print(result.group())

str3='newdream COme on!'
result02=re.match('(.+) (.+) (.+)!',str3,re.I)
print(result02.group(3))